package com.example.person.service;

import cn.hutool.core.collection.ListUtil;
import com.example.person.model.SecurityUser;
import com.example.person.model.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName liweiwei
 * @Description TODO
 * @date 2024/8/14 14:43
 * @Version 1.0
 */
@Service
public class DetailsService implements UserDetailsService {
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        SecurityUser securityUser = new SecurityUser();
        User user = new User();
        user.setUserName("a");
        user.setPassWord("a");
        ArrayList<String> list = new ArrayList<>();
        list.add("admin");
        securityUser.setCurrentUserInfo(user);
        securityUser.setPermissionValueList(list);
        return securityUser;
    }
}
